<template>
  <Card :shadow="shadow">
    <div class="card-name"><div class="name width2">资金流水详情</div></div>
    <div class="content-con">
      <div class="bank-form">
        <div class="form-item">
          <Row :gutter="24">
            <i-col span="12" v-for="(cap, index) in showData" :key="cap.id">
              <Row style="padding-top: 15px;">
                <i-col span="8" class="ban-left">{{ cap.title }}</i-col>
                <i-col span="16">
                  <i-input v-if="cap.title == '备注'" :autosize="{ minRows: 3, maxRows: 5 }" type="textarea" :value.sync="cap.value" size="large" readonly></i-input>
                  <i-input v-else :value.sync="cap.value" size="large" readonly></i-input>
                </i-col>
              </Row>
            </i-col>
          </Row>
        </div>
      </div>
      <div class="ban-btn"><i-button class="save" size="large" @click="btnClick1">返回</i-button></div>
    </div>
  </Card>
</template>
<script>

import { mapMutations } from 'vuex'
export default {
  name: 'cap-view',
  props: {
    shadow: {
      type: Boolean,
      default: false
    }
  },

  data () {
    return {
      value: '',
      capData: [

        {
          title: '流水单号',
          value: this.$route.params.row.bill_no
        },
        {
          title: '商户ID',
          value: this.$route.params.row.uid
        },
        {
          title: '变更金额',
          value: this.$route.params.row.number
        },
        {
          title: '变更后账户余额',
          value: this.$route.params.row.balance
        },
        {
          title: '资金变动方向',
          value: this.$route.params.row.pm
        },
        // {
        //   title: '订单金额',
        //   value: this.$route.params.row.number
        // },
        // {
        //   title: '平台利润',
        //   value: this.$route.params.row.uid
        // },
        // {
        //   title: '总代理商ID',
        //   value: this.$route.params.row.agent_uid
        // },
        // {
        //   title: '总代理商利润',
        //   value: this.$route.params.row.uid
        // },
        // {
        //   title: '商户代理ID',
        //   value: this.$route.params.row.uid
        // },
        // {
        //   title: '商户代理利润',
        //   value: this.$route.params.row.uid
        // },
        // {
        //   title: '业务类型',
        //   value: this.$route.params.row.type
        // },
        {
          title: '业务类目',
          value: this.$route.params.row.billType
        },
        // {
        //   title: '渠道成本(元)',
        //   value: '0'
        // },
        // {
        //   title: '渠道订单号',
        //   value: ''
        // },

        {
          title: '备注',
          value: this.$route.params.row.mark
        },
        {
          title: '创建时间',
          value: this.$route.params.row.add_time
        }
        // {
        //   title: '修改时间',
        //   value: '2020-10-13 23:39:13'
        // }
      ]
    }
  },
  computed: {
    showData () {
      let data = []
      if (this.capData[5].value == 'changes_money') {
        this.capData[5].value = '调账'
      }
      if (this.capData[5].value == 'paid_money') {
        this.capData[5].value = '代付'
      }
      data = this.capData
      return data
    }
  },
  created () {
    console.log(this.capData[5].value)
  },
  methods: {
    ...mapMutations(['closeTag']),
    close () {
      this.closeTag({
        name: 'cap-view',
        params: {
          row: this.$route.params.row
        }
      })
    },
    // 返回按钮
    btnClick1 () {
      this.close()
    }
  }
}
</script>
<style lang="less"></style>
